
{include file="public/head"/}
<div class="container-fluid" id="main">
    <div class="row clearfix" id="mainAlert">
        <div class="col-md-12 column">
            <div class="alert alert-dismissable alert-info">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <p></p>
            </div>
        </div>
    </div>

    <div class="ntDesktop">
    	<div class="ntDesktop-head">码头仓库</div>
        <div class="row" style="padding-top:0px">
            <div class="col-md-5"> 
                <ul class="nav nav-tabs">
                    <li :class="{'active':index==0}" v-for="(item,index) in port" @click="changeterminal(item.id)">
                        <a href="#" data-toggle="tab">{{item.name}}</a>
                    </li>
				</ul>
            </div>

            <div class="col-md-4"> 
                <ul class="nav nav-tabs">
                    <li :class="{'active':index==0}" v-for="(item,index) in montharr" @click="changemonth(item)">
                        <a href="#" data-toggle="tab">{{item.splyear}}-{{item.month}}</a>
                    </li>
                </ul>
            </div>
			<div class="col-md-1">
				<button type="button" class="btn btn-default btn-checkbox">
					<input type="checkbox" checked> 隐藏未入库内容
				</button>
			</div>
			<div class="col-md-2 text-right">
				<button type="button" data-toggle="modal" data-target="#moveto_Modal" class="btn btn-primary" @click="setselectportId()" v-if="auth_ids.indexOf(293) != -1">
					选择产品调整到...
				</button>
			</div>
		</div>
    
        <div class="row">
            <div class="col-md-12">
				<table class="table table-striped table-hover ntTable" >
                    <thead>
                        <tr>
                            <th class="text-center" style="vertical-align:middle"><input type="checkbox" @click="allsel" id="allsel"></th>
                            <th>&nbsp;</th>
                            <th>产品</th>
                            <th class="col-md-1">箱数</th>
                            <th>数量</th>
                            <th>重量</th>
                            <th>体积</th>
                            <th>金额</th>
                        </tr>
                    </thead>
                    <tbody>
                        <template v-for="(item,index) in listdata.content">
                    	<tr class="tr-mid">
                        	<td style="vertical-align:middle" align="center"></td>
                            <td colspan="4">{{formatUnit(item.id,'id')}} / {{item.company_name}} / 交货： {{item.port_name}} / {{item.delivery_day}} </td>
                            <td colspan="3" align="right">
                                {{formatUnit(item.CTN,'UN')}} <span class="unit">CTN</span> /
                            	{{formatUnit(item.KGS,'KG')}} <span class="unit">KGS</span> /
                                {{formatUnit(item.CBM,'M3')}} <span class="unit">CBM</span> /
                                {{formatUnit(item.CNY,'$')}} <span class="unit">CNY</span>
                           </td>
                        </tr>
                        <tr v-for="(element,key) in item.buy_po_pack">
                            <td style="vertical-align:middle" align="center"><input type="checkbox" class="listdataItem"  @click="onesel(element.id)" ></td>
                            <!-- <td style="vertical-align:middle" align="center"><input type="checkbox"  v-model="batch" :value="element.id" @click="onesel(element.id)"></td> -->
                            <td style="vertical-align:middle" align="center" style="width: 48px;height:48;"><img :src="element.proinfo.img_url" border="0"></td>
                            <td> <small>{{formatUnit(element.proinfo.prochar_id,'id') +(element.proinfo.brand_name ? ' / '+element.proinfo.brand_name:'') + (element.proinfo.model ? ' / ' + element.proinfo.model : '')}}</small> <br />{{element.proinfo.pro_name}} </td>
                            <td align="center"><input type="number" class="form-control text-right" :value="element.qty"></td>


                            
                            <td>
                                {{formatUnit(element.ctn_qty,'UN')}} <span class="unit">PCS/CTN</span><br>
                                {{formatUnit(element.sum_qty,'UN')}} <span class="unit">PCS</span>
                            </td>
                            <td>
                                {{formatUnit(element.ctn_kgs,'KG')}} <span class="unit">KGS/CTN</span><br>
                                {{formatUnit(element.sum_kgs,'KG')}} <span class="unit">KGS</span>
                            </td>
                            <td>
                                {{formatUnit(element.ctn_size,'M')}} <span class="unit">CM</span><br>
                                {{formatUnit(element.ctn_m3,'M3')}} <span class="unit">CBM/CTN</span> / 
                                {{formatUnit(element.sum_m3,'M3')}} <span class="unit">CBM</span>
                            </td>
                            <td>
                                {{element.price}} <span class="unit">CNY/PC</span><br>
                                {{formatUnit(element.sum_price,'$')}} <span class="unit">CNY</span>
                            </td>
                        </tr>
                        </template>
                        <tr style="text-align: center;" v-if="listdata.content.length==0">
                            <td colspan="8" class="no_date">{:lang('no_data')}</td>
                        </tr>
                    </tbody>
                    <tfoot v-if="listdata.content.length">
                        <tr>
                            <td colspan="2" align="center">{:strtoupper(lang('total'))}</td>
                            <td colspan="6" align="right">
                                <b>
                                {:strtoupper(lang('product'))}： {{formatUnit(listdata.footer.num,'UN')}} <span class="unit">UN</span> / 
                                {:strtoupper(lang("box_quantity"))}： {{formatUnit(listdata.footer.sum_CTN,'UN')}} <span class="unit">CTN</span> / 
                                {:strtoupper(lang("volume"))}： {{formatUnit(listdata.footer.sum_CBM,'M3')}} <span class="unit">CBM</span> / 
                                {:strtoupper(lang("weight"))}： {{formatUnit(listdata.footer.sum_KGS,'KG')}} <span class="unit">KGS</span> / 
                                {:strtoupper(lang('amount'))}： {{formatUnit(listdata.footer.sum_CNY,'$')}} <span class="unit">CNY</span>
                                </b>
                            </td>
                        </tr>
                        
                    </tfoot>
                </table>
                <ul class="pagination" id="pagination">
                </ul>
            </div>
        </div>
    </div>

    <div class="modal fade" id="moveto_Modal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" style="width:60%">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="ntModalLabel">移动到...</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="alert alert-dismissable alert-info">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <p></p>
                            </div>
                        </div>
                    </div>
                   <div class="row">
                        <div class="col-md-12">
                            选择的产品移动到
                        </div>
                        <div class="col-md-2">
                            指定码头仓库
                        </div>
                        <div class="col-md-10">
                            <select class="form-control" id="selectportId">
                                <option value="0">请选择转移码头</option>
                                <option v-for="(item,index) in port" :value="item.id">{{item.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>取消</button>
                    <button type="button" class="btn btn-primary" style="padding-left:24px;padding-right:24px" @click="movePort()"><span class="glyphicon glyphicon-floppy-disk"></span>继续保存</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<script src="/static/Admin/js/receipt.js"></script>
{include file="public/foot"/}